#include <iostream>
#include <cstdio>
using namespace std;
int a[21][21][21];
int fnl(int x,int y, int z) {
    if (x<=0 || y<=0 || z<=0) return 1;
    else if (x>20 || y>20 || z>20) return a[20][20][20];
    else return a[x][y][z];
}
int main() {
    a[0][0][0]=1;
    for (int i=0; i<21; i++) {
        for (int j=0; j<21; j++) {
            for (int k=0; k<21; k++) {
                if (i<j && j<k) a[i][j][k] = fnl(i,j,k-1) + fnl(i,j-1,k-1) - fnl(i,j-1,k);
                else a[i][j][k] = fnl(i-1,j,k) + fnl(i-1,j-1,k) + fnl(i-1,j,k-1) - fnl(i-1,j-1,k-1);
            }
        }
    }
    int a1,b,c;
    while (cin>>a1>>b>>c && (a1!=-1 || b!=-1 || c!=-1)) {
        printf("w(%d, %d, %d) = %d\n",a1,b,c,fnl(a1,b,c));
    }
    return 0;
}
